import org.openrndr.math.Vector3
import org.openrndr.shape.Path3D
import org.openrndr.shape.path3D
import kotlin.test.Test
import kotlin.test.assertEquals

class TestPath {
    @Test
    fun `calling sub on a path3D should not throw exceptions`() {
        val c = path3D {
            moveTo(0.0, 0.0, 0.0)
            lineTo(100.0, 100.0, 100.0)
        }

        val fullLength = c.length
        val sub = c.sub(0.0, 0.01)
        assertEquals(
            fullLength * 0.01,
            sub.length,
            fullLength * 1e-5
        )
    }

    @Test
    fun `calling sampleEquidistant on a path3D should not throw exceptions`() {
        val c = path3D {
            moveTo(0.0, 0.0, 0.0)
            lineTo(100.0, 100.0, 100.0)
            lineTo(200.0, 200.0, 200.0)
            lineTo(300.0, 300.0, 300.0)
            lineTo(400.0, 400.0, 400.0)
        }

        val fullLength = c.length
        val sub = c.sampleEquidistant(600).sub(0.0, 0.01)
        assertEquals(
            fullLength * 0.01,
            sub.length,
            fullLength * 1e-5
        )
    }

    @Test
    fun `creating a path3D from points should not throw exceptions`() {
        val c = Path3D.fromPoints(
            listOf(
                Vector3(x = 28740.274250000002, y = -315192.39225, z = 0.0),
                Vector3(x = 28742.0215, y = -315191.7295, z = 0.0),
                Vector3(x = 28745.455749999997, y = -315190.58475, z = 0.0),
                Vector3(x = 28746.66075, y = -315189.8015, z = 0.0),
                Vector3(x = 28747.0825, y = -315188.235, z = 0.0),
                Vector3(x = 28746.54025, y = -315186.96975, z = 0.0),
                Vector3(x = 28746.17875, y = -315190.22325, z = 0.0),
                Vector3(x = 28746.66075, y = -315187.03, z = 0.0),
                Vector3(x = 28748.167, y = -315188.3555, z = 0.0),
                Vector3(x = 28750.275749999997, y = -315190.46424999996, z = 0.0),
                Vector3(x = 28750.75775, y = -315192.332, z = 0.0),
                Vector3(x = 28750.998750000002, y = -315194.983, z = 0.0),
                Vector3(x = 28751.239749999997, y = -315196.91099999996, z = 0.0),
                Vector3(x = 28751.48075, y = -315199.62224999996, z = 0.0),
                Vector3(x = 28748.829749999997, y = -315202.03225, z = 0.0),
                Vector3(x = 28741.59975, y = -315201.972, z = 0.0),
                Vector3(x = 28739.06925, y = -315201.91174999997, z = 0.0),
                Vector3(x = 28704.9075, y = -315200.64650000003, z = 0.0),
                Vector3(x = 28698.400499999996, y = -315200.46575, z = 0.0),
                Vector3(x = 28595.192249999996, y = -315196.97125, z = 0.0),
                Vector3(x = 28589.76975, y = -315196.73025, z = 0.0),
                Vector3(x = 28583.14225, y = -315196.54949999996, z = 0.0),
                Vector3(x = 28579.708000000002, y = -315196.54949999996, z = 0.0),
                Vector3(x = 28576.334, y = -315198.41725, z = 0.0),
                Vector3(x = 28576.213499999998, y = -315200.58625, z = 0.0),
                Vector3(x = 28576.51475, y = -315203.53849999997, z = 0.0),
                Vector3(x = 28576.63525, y = -315205.76775, z = 0.0),
                Vector3(x = 28577.298000000003, y = -315212.094, z = 0.0),
                Vector3(x = 28577.84025, y = -315218.42025, z = 0.0),
                Vector3(x = 28578.32225, y = -315223.60175000003, z = 0.0),
                Vector3(x = 28578.32225, y = -315228.06025000004, z = 0.0),
                Vector3(x = 28574.888000000003, y = -315229.8075, z = 0.0),
                Vector3(x = 28571.6345, y = -315230.04850000003, z = 0.0),
                Vector3(x = 28567.898999999998, y = -315230.10875, z = 0.0),
                Vector3(x = 28563.6815, y = -315230.22925, z = 0.0),
                Vector3(x = 28558.80125, y = -315230.47025, z = 0.0),
                Vector3(x = 28553.01725, y = -315230.651, z = 0.0),
                Vector3(x = 28546.932, y = -315230.7715, z = 0.0),
                Vector3(x = 28540.72625, y = -315231.07275, z = 0.0),
                Vector3(x = 28529.03775, y = -315231.374, z = 0.0),
                Vector3(x = 28523.494749999998, y = -315231.9765, z = 0.0),
                Vector3(x = 28519.27725, y = -315233.72375, z = 0.0),
                Vector3(x = 28515.7225, y = -315236.13375000004, z = 0.0),
                Vector3(x = 28510.540999999997, y = -315239.809, z = 0.0),
                Vector3(x = 28506.564499999997, y = -315242.64074999996, z = 0.0),
                Vector3(x = 28502.347, y = -315245.65325, z = 0.0),
                Vector3(x = 28498.06925, y = -315248.72599999997, z = 0.0),
                Vector3(x = 28489.39325, y = -315254.93175, z = 0.0),
                Vector3(x = 28484.995000000003, y = -315258.06475, z = 0.0),
                Vector3(x = 28476.98175, y = -315263.668, z = 0.0),
                Vector3(x = 28466.980249999997, y = -315270.2955, z = 0.0),
                Vector3(x = 28461.9795, y = -315272.9465, z = 0.0),
                Vector3(x = 28456.73775, y = -315275.77825000003, z = 0.0),
                Vector3(x = 28451.375500000002, y = -315278.61, z = 0.0),
                Vector3(x = 28440.5305, y = -315284.5145, z = 0.0),
                Vector3(x = 28435.40925, y = -315287.1655, z = 0.0),
                Vector3(x = 28430.6495, y = -315289.75625, z = 0.0),
                Vector3(x = 28425.8295, y = -315292.40725, z = 0.0),
                Vector3(x = 28423.058, y = -315293.91349999997, z = 0.0),
                Vector3(x = 28421.13, y = -315294.99799999996, z = 0.0),
                Vector3(x = 28418.479, y = -315296.3235, z = 0.0),
                Vector3(x = 28414.92425, y = -315297.2875, z = 0.0),
                Vector3(x = 28412.032250000004, y = -315297.408, z = 0.0),
                Vector3(x = 28406.7905, y = -315295.90175, z = 0.0),
                Vector3(x = 28404.561250000002, y = -315294.33525, z = 0.0),
                Vector3(x = 28401.91025, y = -315292.588, z = 0.0),
                Vector3(x = 28400.5245, y = -315291.624, z = 0.0),
                Vector3(x = 28398.958, y = -315290.5395, z = 0.0),
                Vector3(x = 28397.331250000003, y = -315289.39475000004, z = 0.0),
                Vector3(x = 28396.066000000003, y = -315288.491, z = 0.0),
                Vector3(x = 28394.017499999998, y = -315287.045, z = 0.0),
                Vector3(x = 28392.752249999998, y = -315286.26175, z = 0.0),
                Vector3(x = 28389.980750000002, y = -315284.21325, z = 0.0),
                Vector3(x = 28387.691249999996, y = -315282.707, z = 0.0),
                Vector3(x = 28385.28125, y = -315281.1405, z = 0.0),
                Vector3(x = 28381.786750000003, y = -315280.11625, z = 0.0),
                Vector3(x = 28378.05125, y = -315280.11625, z = 0.0),
                Vector3(x = 28375.4605, y = -315280.29699999996, z = 0.0),
                Vector3(x = 28373.653, y = -315280.538, z = 0.0),
                Vector3(x = 28371.66475, y = -315281.02, z = 0.0),
                Vector3(x = 28370.459749999998, y = -315282.5865, z = 0.0),
                Vector3(x = 28370.761000000002, y = -315284.21325, z = 0.0),
                Vector3(x = 28371.122499999998, y = -315285.4785, z = 0.0),
                Vector3(x = 28371.3635, y = -315286.74374999997, z = 0.0),
                Vector3(x = 28372.146749999996, y = -315295.17875, z = 0.0),
                Vector3(x = 28373.95425, y = -315313.43450000003, z = 0.0),
                Vector3(x = 28375.701500000003, y = -315333.799, z = 0.0),
                Vector3(x = 28379.0755, y = -315370.37075, z = 0.0),
                Vector3(x = 28382.87125, y = -315415.55825, z = 0.0),
                Vector3(x = 28387.932249999998, y = -315477.37475, z = -7.125),
                Vector3(x = 28390.6435, y = -315511.5365, z = -35.625),
                Vector3(x = 28395.28275, y = -315573.89525, z = -90.25),
                Vector3(x = 28396.6685, y = -315608.6595, z = -114.0),
                Vector3(x = 28397.572249999997, y = -315677.3445, z = -140.125),
                Vector3(x = 28398.53625, y = -315711.86775, z = -154.375),
                Vector3(x = 28403.536999999997, y = -315787.90325000003, z = -178.125),
                Vector3(x = 28411.791250000002, y = -315866.83074999996, z = -206.625),
                Vector3(x = 28416.37025, y = -315907.62, z = -218.5),
                Vector3(x = 28424.504, y = -315971.36449999997, z = -239.875),
                Vector3(x = 28432.517249999997, y = -316036.97675000003, z = -266.0),
                Vector3(x = 28438.722999999998, y = -316083.55000000005, z = -282.625),
                Vector3(x = 28453.0625, y = -316202.2425, z = -349.125),
                Vector3(x = 28459.087499999998, y = -316253.455, z = -380.0),
                Vector3(x = 28468.7275, y = -316337.805, z = -434.625),
                Vector3(x = 28479.5725, y = -316417.335, z = -479.75),
                Vector3(x = 28519.3375, y = -316507.71, z = -505.875),
                Vector3(x = 28541.629999999997, y = -316533.015, z = -515.375),
                Vector3(x = 28609.11, y = -316584.83, z = -551.0),
                Vector3(x = 28682.0125, y = -316629.415, z = -593.75),
                Vector3(x = 28727.802499999998, y = -316657.7325, z = -615.125),
                Vector3(x = 28819.3825, y = -316714.3675, z = -646.0),
                Vector3(x = 28974.225000000002, y = -316810.7675, z = -719.625),
                Vector3(x = 29088.7, y = -316881.26, z = -767.125),
                Vector3(x = 29200.764999999996, y = -316946.9325, z = -817.0),
                Vector3(x = 29332.7125, y = -317024.655, z = -871.625),
                Vector3(x = 29448.995000000003, y = -317092.7375, z = -914.375),
                Vector3(x = 29533.344999999998, y = -317142.1425, z = -945.25),
                Vector3(x = 29730.90475, y = -317248.9055, z = -1002.25),
                Vector3(x = 30204.1685, y = -317446.94725, z = -1066.375),
                Vector3(x = 30367.26525, y = -317512.25824999996, z = -1087.75),
                Vector3(x = 30557.354000000003, y = -317588.595, z = -1113.875),
                Vector3(x = 30798.896249999998, y = -317684.87450000003, z = -1168.5),
                Vector3(x = 31320.601, y = -317891.47175, z = -1301.5),
                Vector3(x = 31838.208749999998, y = -318096.38200000004, z = -1446.375),
                Vector3(x = 32363.468249999998, y = -318306.59425, z = -1558.0),
                Vector3(x = 32896.31925, y = -318517.7705, z = -1672.0),
                Vector3(x = 33446.64275, y = -318735.15249999997, z = -1767.0),
                Vector3(x = 34492.5225, y = -319145.214, z = -1959.375),
                Vector3(x = 35555.99525, y = -319559.79425, z = -2135.125),
                Vector3(x = 36645.43575, y = -319982.14675, z = -2289.5),
                Vector3(x = 37727.88725, y = -320397.14875, z = -2439.125),
                Vector3(x = 38967.10925, y = -320870.11125, z = -2591.125),
                Vector3(x = 40162.83075, y = -321323.131, z = -2719.375),
                Vector3(x = 41358.251000000004, y = -321771.0295, z = -2835.75),
                Vector3(x = 42543.8505, y = -322212.5415, z = -2947.375),
                Vector3(x = 43726.85925, y = -322650.1975, z = -2945.0),
                Vector3(x = 44812.8655, y = -323048.691, z = -2945.0),
                Vector3(x = 45944.78225, y = -323460.1985, z = -2945.0),
                Vector3(x = 47391.565500000004, y = -323982.325, z = -2945.0),
                Vector3(x = 47731.67675, y = -324104.33125, z = -2945.0),
                Vector3(x = 49425.906749999995, y = -324708.45800000004, z = -2945.0),
                Vector3(x = 50527.2165, y = -325097.0705, z = -2945.0),
                Vector3(x = 51694.560249999995, y = -325506.10775, z = -2945.0),
                Vector3(x = 52401.65425, y = -325752.16875, z = -2945.0),
                Vector3(x = 54066.602750000005, y = -326327.19475, z = -2945.0),
                Vector3(x = 55209.84650000001, y = -326718.2775, z = -2945.0),
                Vector3(x = 56360.501000000004, y = -327108.81799999997, z = -2945.0),
                Vector3(x = 57572.007999999994, y = -327516.7105, z = -2945.0),
                Vector3(x = 58702.840249999994, y = -327894.17675, z = -2945.0),
                Vector3(x = 59923.8065, y = -328299.17725, z = -2945.0),
                Vector3(x = 61063.67625, y = -328673.32975, z = -2945.0),
                Vector3(x = 62278.01500000001, y = -329069.47349999996, z = -2945.0),
                Vector3(x = 63457.64975, y = -329450.79575, z = -2945.0),
                Vector3(x = 64687.713749999995, y = -329845.31275, z = -2945.0),
                Vector3(x = 65854.15375, y = -330216.21175, z = -2945.0),
                Vector3(x = 67019.5695, y = -330584.1585, z = -2945.0),
                Vector3(x = 68248.00675, y = -330968.674, z = -2945.0),
                Vector3(x = 69498.2545, y = -331356.38275, z = -2945.0),
                Vector3(x = 70729.2825, y = -331734.81299999997, z = -2945.0),
                Vector3(x = 71882.70850000001, y = -332087.0345, z = -2945.0),
                Vector3(x = 73121.81, y = -332461.428, z = -2945.0),
                Vector3(x = 74297.22725, y = -332813.46875, z = -2945.0),
                Vector3(x = 75479.6335, y = -333165.44925, z = -2945.0),
                Vector3(x = 76710.42050000001, y = -333528.39525, z = -2945.0),
                Vector3(x = 77930.1215, y = -333885.256, z = -2945.0),
                Vector3(x = 79170.36774999999, y = -334244.34599999996, z = -2945.0),
                Vector3(x = 80348.7975, y = -334582.77025, z = -2945.0),
                Vector3(x = 81598.985, y = -334938.84775, z = -2945.0),
                Vector3(x = 82877.18875, y = -335299.56450000004, z = -2945.0),
                Vector3(x = 84090.50325, y = -335638.95275, z = -2945.0),
                Vector3(x = 85382.8055, y = -335997.44025, z = -2945.0),
                Vector3(x = 86663.2385, y = -336348.8785, z = -2945.0),
                Vector3(x = 87935.35699999999, y = -336695.25575, z = -2945.0),
                Vector3(x = 89215.79000000001, y = -337040.24724999996, z = -2945.0),
                Vector3(x = 90485.31775, y = -337379.3945, z = -2945.0),
                Vector3(x = 91759.00275, y = -337716.433, z = -2945.0),
                Vector3(x = 93083.358, y = -338063.41275, z = -2945.0),
                Vector3(x = 94415.4855, y = -338408.40424999996, z = -2945.0),
                Vector3(x = 95753.81874999999, y = -338752.55225, z = -2945.0),
                Vector3(x = 97134.568, y = -339103.9905, z = -2945.0),
                Vector3(x = 98472.90125, y = -339441.1495, z = -2945.0),
                Vector3(x = 99891.90925, y = -339794.2145, z = -2945.0),
                Vector3(x = 101322.84675000001, y = -340147.09875, z = -2945.0),
                Vector3(x = 102767.15974999999, y = -340499.3805, z = -2945.0),
                Vector3(x = 104214.24425, y = -340847.92675000004, z = -2945.0),
                Vector3(x = 105676.51175, y = -341196.77425, z = -2945.0),
                Vector3(x = 107081.05975, y = -341528.02875, z = -2945.0),
                Vector3(x = 108556.46174999999, y = -341872.29725, z = -2945.0),
                Vector3(x = 110051.98724999999, y = -342217.28875, z = -2945.0),
                Vector3(x = 111566.06975, y = -342561.738, z = -2945.0),
                Vector3(x = 113069.90975, y = -342899.86100000003, z = -2945.0),
                Vector3(x = 114588.20975, y = -343238.82749999996, z = -2945.0),
                Vector3(x = 116026.37725, y = -343554.35675, z = -2945.0),
                Vector3(x = 117241.13775, y = -343819.09525, z = -2945.0),
                Vector3(x = 118183.80925, y = -344022.13775, z = -2945.0),
                Vector3(x = 120448.667, y = -344527.575, z = -2945.0),
                Vector3(x = 121994.5615, y = -344930.34625, z = -2945.0),
                Vector3(x = 123577.50975, y = -345341.25125, z = -2945.0),
                Vector3(x = 125342.11175, y = -345794.21075, z = -2945.0),
                Vector3(x = 127083.638, y = -346234.57800000004, z = -2945.0),
                Vector3(x = 128753.94875, y = -346651.86950000003, z = -2945.0),
                Vector3(x = 128977.95825, y = -346707.179, z = -2945.0),
                Vector3(x = 130752.14, y = -347144.17225, z = -2945.0),
                Vector3(x = 133164.068, y = -347727.51275, z = -2945.0),
                Vector3(x = 134760.99425, y = -348105.64175, z = -2945.0),
                Vector3(x = 136351.47375, y = -348478.529, z = -2945.0),
                Vector3(x = 136923.18600000002, y = -348611.1995, z = -2945.0),
                Vector3(x = 139261.0065, y = -349148.68975, z = -2945.0),
                Vector3(x = 141399.58025, y = -349631.71400000004, z = -2945.0),
                Vector3(x = 141626.06, y = -349682.38425, z = -2945.0),
                Vector3(x = 144230.54700000002, y = -350258.555, z = -2945.0),
                Vector3(x = 145839.463, y = -350608.60750000004, z = -2945.0),
                Vector3(x = 147615.633, y = -350990.3515, z = -2945.0),
                Vector3(x = 149277.6895, y = -351341.91025, z = -2945.0),
                Vector3(x = 150980.5955, y = -351696.90325, z = -2942.625),
                Vector3(x = 152588.90899999999, y = -352028.39875, z = -2945.0),
                Vector3(x = 154313.746, y = -352378.69224999996, z = -2945.0),
                Vector3(x = 156011.2295, y = -352685.60575, z = -2945.0),
                Vector3(x = 157759.08200000002, y = -352976.67350000003, z = -2945.0),
                Vector3(x = 159506.091, y = -353261.23425, z = -2945.0),
                Vector3(x = 161235.08525, y = -353538.98675, z = -2945.0),
                Vector3(x = 162959.07875, y = -353812.46150000003, z = -2945.0),
                Vector3(x = 164634.9325, y = -354178.29949999996, z = -2945.0),
                Vector3(x = 166285.48125, y = -354463.1615, z = -2945.0),
                Vector3(x = 168017.97, y = -354712.53625, z = -2945.0),
                Vector3(x = 169688.1, y = -354948.2945, z = -2945.0),
                Vector3(x = 171442.339, y = -355192.1865, z = -2945.0),
                Vector3(x = 173188.9865, y = -355430.29449999996, z = -2945.0),
                Vector3(x = 174860.924, y = -355654.6655, z = -2945.0),
                Vector3(x = 176625.6465, y = -355886.56775, z = -2945.0),
                Vector3(x = 178315.23725, y = -356104.733, z = -2945.0),
                Vector3(x = 180064.4755, y = -356325.8505, z = -2945.0),
                Vector3(x = 181174.94325, y = -356464.12425, z = -2945.0),
                Vector3(x = 183117.343, y = -356720.18675, z = -2945.0),
                Vector3(x = 185609.283, y = -357098.858, z = -2945.0),
                Vector3(x = 187260.07275, y = -357345.642, z = -2945.0),
                Vector3(x = 188921.76775, y = -357590.25700000004, z = -2945.0),
                Vector3(x = 190665.64375, y = -357842.04175000003, z = -2945.0),
                Vector3(x = 192525.26, y = -358105.21375, z = -2945.0),
                Vector3(x = 194333.30224999998, y = -358279.45675, z = -2945.0),
                Vector3(x = 196397.40699999998, y = -358430.32275, z = -2945.0),
                Vector3(x = 196639.49149999997, y = -358447.67475, z = -2945.0),
                Vector3(x = 199079.85749999998, y = -358618.66425, z = -2945.0),
                Vector3(x = 200782.10074999998, y = -358735.60949999996, z = -2945.0),
                Vector3(x = 202579.77999999997, y = -358854.24175, z = -2945.0),
                Vector3(x = 204282.98725, y = -358962.8725, z = -2945.0),
                Vector3(x = 206061.50699999998, y = -359071.8045, z = -2945.0),
                Vector3(x = 207861.95775, y = -359178.26625, z = -2945.0),
                Vector3(x = 209561.42949999997, y = -359275.088, z = -2945.0),
                Vector3(x = 211349.77000000002, y = -359372.452, z = -2945.0),
                Vector3(x = 213580.466, y = -359488.31275000004, z = -2945.0),
                Vector3(x = 215268.67099999997, y = -359572.1205, z = -2945.0),
                Vector3(x = 216990.43524999998, y = -359653.217, z = -2945.0),
                Vector3(x = 218884.15300000002, y = -359738.1695, z = -2945.0),
                Vector3(x = 220699.42524999997, y = -359815.10875, z = -2945.0),
                Vector3(x = 222408.35625, y = -359883.79375, z = -2945.0),
                Vector3(x = 224266.70725, y = -359954.40675, z = -2945.0),
                Vector3(x = 225956.23775, y = -360014.53625, z = -2945.0),
                Vector3(x = 227723.61125, y = -360074.1235, z = -2945.0),
                Vector3(x = 228046.1295, y = -360084.2455, z = -2945.0),
                Vector3(x = 230568.79700000002, y = -360163.71525, z = -2945.0),
                Vector3(x = 232349.90750000003, y = -360211.7345, z = -2945.0),
                Vector3(x = 234037.751, y = -360253.9095, z = -2945.0),
                Vector3(x = 236074.86375, y = -360300.48275, z = -2945.0),
                Vector3(x = 237375.601, y = -360327.83625, z = -2954.5),
                Vector3(x = 239919.17525, y = -360374.53, z = -3135.0),
                Vector3(x = 241628.46774999998, y = -360402.004, z = -3135.0),
                Vector3(x = 243418.25425, y = -360426.70650000003, z = -3135.0),
                Vector3(x = 243748.84600000002, y = -360430.442, z = -3135.0),
                Vector3(x = 246267.47675000003, y = -360457.49425, z = -3135.0),
                Vector3(x = 247983.51725, y = -360470.99025000003, z = -3135.0),
                Vector3(x = 248429.48775000003, y = -360473.82200000004, z = -3135.0),
                Vector3(x = 251756.49275, y = -360433.2135, z = -3135.0),
                Vector3(x = 253533.205, y = -360310.48425000004, z = -3135.0),
                Vector3(x = 255323.7145, y = -360183.05549999996, z = -3135.0),
                Vector3(x = 257098.25775, y = -360052.313, z = -3135.0),
                Vector3(x = 258782.3055, y = -359924.64324999996, z = -3135.0),
                Vector3(x = 260531.90525, y = -359788.0565, z = -3135.0),
                Vector3(x = 262262.04425000004, y = -359648.397, z = -3135.0),
                Vector3(x = 264057.25325, y = -359499.5795, z = -3135.0),
                Vector3(x = 264795.07475, y = -359437.1605, z = -3135.0),
                Vector3(x = 268714.518, y = -359094.6995, z = -3135.0),
                Vector3(x = 270307.528, y = -358949.67775, z = -3135.0),
                Vector3(x = 272035.67875, y = -358788.027, z = -3135.0),
                Vector3(x = 273618.80775000004, y = -358636.92, z = -3135.0),
                Vector3(x = 275349.36850000004, y = -358484.66825, z = -3135.0),
                Vector3(x = 277354.2475, y = -358321.0895, z = -3135.0),
                Vector3(x = 278102.61275000003, y = -358256.68225, z = -3135.0),
                Vector3(x = 279871.55275, y = -358100.695, z = -3135.0),
                Vector3(x = 282219.97725, y = -357887.83175, z = -3135.0),
                Vector3(x = 283896.73475, y = -357731.6035, z = -3135.0),
                Vector3(x = 285571.56425, y = -357572.3025, z = -3135.0),
                Vector3(x = 287256.03375, y = -357407.338, z = -3135.0),
                Vector3(x = 288915.9815, y = -357241.59025, z = -3135.0),
                Vector3(x = 290597.73975, y = -357070.05850000004, z = -3135.0),
                Vector3(x = 292244.4325, y = -356899.12925, z = -3135.0),
                Vector3(x = 293807.98024999996, y = -356733.68275000004, z = -3135.0),
                Vector3(x = 294311.7305, y = -356678.67449999996, z = -3135.0),
                Vector3(x = 296778.66675, y = -356328.381, z = -3135.0),
                Vector3(x = 298504.22675, y = -356084.66975, z = -3135.0),
                Vector3(x = 300159.8365, y = -355848.791, z = -3135.0),
                Vector3(x = 301724.77, y = -355622.07025000005, z = -3135.0),
                Vector3(x = 303363.02775, y = -355386.01075, z = -3135.0),
                Vector3(x = 304941.45725, y = -355145.071, z = -3135.0),
                Vector3(x = 306498.67875, y = -354936.06375000003, z = -3135.0),
                Vector3(x = 308190.61925, y = -354719.82649999997, z = -3135.0),
                Vector3(x = 309799.716, y = -354504.43275, z = -3135.0),
                Vector3(x = 311461.411, y = -354276.44675, z = -3135.0),
                Vector3(x = 313124.793, y = -354044.48425, z = -3135.0),
                Vector3(x = 314187.18125, y = -353894.64249999996, z = -3135.0),
                Vector3(x = 316586.517, y = -353551.94049999997, z = -3135.0),
                Vector3(x = 318142.0515, y = -353305.6385, z = -3135.0),
                Vector3(x = 319713.67274999997, y = -352981.7345, z = -3135.0),
                Vector3(x = 321271.798, y = -352653.07075, z = -3135.0),
                Vector3(x = 322772.92675000004, y = -352333.26375, z = -3135.0),
                Vector3(x = 324341.11374999996, y = -351995.26125, z = -3135.0),
                Vector3(x = 325828.92725, y = -351669.851, z = -3135.0),
                Vector3(x = 327393.5595, y = -351323.95575, z = -3135.0),
                Vector3(x = 328883.9035, y = -350990.29125, z = -3135.0),
                Vector3(x = 330445.70399999997, y = -350636.08150000003, z = -3135.0),
                Vector3(x = 332010.09525, y = -350384.77875, z = -3135.0),
                Vector3(x = 333134.23975, y = -350281.26925, z = -3135.0),
                Vector3(x = 335490.9185, y = -350058.88649999996, z = -3135.0),
                Vector3(x = 337174.18299999996, y = -349894.22325, z = -3135.0),
                Vector3(x = 338771.6515, y = -349734.07875, z = -3135.0),
                Vector3(x = 340428.10475, y = -349564.957, z = -3135.0),
                Vector3(x = 342072.267, y = -349393.365, z = -3135.0),
                Vector3(x = 343506.63875000004, y = -349240.14925, z = -3135.0),
                Vector3(x = 345832.4695, y = -348986.25575, z = -3135.0),
                Vector3(x = 347584.96125, y = -348789.66, z = -3135.0),
                Vector3(x = 349154.35325, y = -348610.115, z = -3135.0),
                Vector3(x = 350732.12, y = -348425.93075, z = -3135.0),
                Vector3(x = 352198.7255, y = -348251.266, z = -3135.0),
                Vector3(x = 353726.24375, y = -348065.51525, z = -3135.0),
                Vector3(x = 355215.5635, y = -347881.81299999997, z = -3135.0),
                Vector3(x = 356697.593, y = -347694.97775, z = -3135.0),
                Vector3(x = 358268.12975, y = -347494.16449999996, z = -3135.0),
                Vector3(x = 359833.78625, y = -347290.2785, z = -3135.0),
                Vector3(x = 361326.41975, y = -347092.056, z = -3135.0),
                Vector3(x = 362789.41025, y = -346895.159, z = -3135.0),
                Vector3(x = 364345.42675, y = -346682.2355, z = -3135.0),
                Vector3(x = 365845.04925, y = -346550.10725, z = -3135.0),
                Vector3(x = 367370.09725, y = -346505.16075, z = -3135.0),
                Vector3(x = 368893.09674999997, y = -346457.262, z = -3135.0),
                Vector3(x = 370486.82975000003, y = -346402.85625, z = -3135.0),
                Vector3(x = 371999.34575, y = -346348.69149999996, z = -3135.0),
                Vector3(x = 373499.87200000003, y = -346292.59875, z = -3135.0),
                Vector3(x = 375080.53075, y = -346230.481, z = -3135.0),
                Vector3(x = 376590.697, y = -346169.20675, z = -3135.0),
                Vector3(x = 378076.76325, y = -346105.82375, z = -3135.0),
                Vector3(x = 379585.90525, y = -346039.06675, z = -3135.0),
                Vector3(x = 381155.23699999996, y = -345965.68225, z = -3135.0),
                Vector3(x = 382700.6495, y = -345890.43, z = -3135.0),
                Vector3(x = 384243.95324999996, y = -345794.753, z = -3135.0),
                Vector3(x = 385686.33825000003, y = -345601.10949999996, z = -3135.0),
                Vector3(x = 387209.27749999997, y = -345382.161, z = -3135.0),
                Vector3(x = 388720.8295, y = -345162.54975, z = -3135.0),
                Vector3(x = 390158.99700000003, y = -344950.1685, z = -3135.0),
                Vector3(x = 391658.55925000005, y = -344725.61675, z = -3135.0),
                Vector3(x = 393071.6025, y = -344510.464, z = -3135.0),
                Vector3(x = 394495.24974999996, y = -344326.76175, z = -3135.0),
                Vector3(x = 395987.52174999996, y = -344148.723, z = -3135.0),
                Vector3(x = 397405.56575, y = -343975.74525000004, z = -3135.0),
                Vector3(x = 398814.21075, y = -343801.74325, z = -3135.0),
                Vector3(x = 400291.36, y = -343615.45025, z = -3135.0),
                Vector3(x = 401763.08675, y = -343427.22925, z = -3135.0),
                Vector3(x = 403214.44899999996, y = -343238.28524999996, z = -3135.0),
                Vector3(x = 404657.798, y = -343047.41325000004, z = -3135.0),
                Vector3(x = 406096.38724999997, y = -342853.83, z = -3135.0),
                Vector3(x = 407558.3535, y = -342654.70375, z = -3135.0),
                Vector3(x = 408956.1535, y = -342460.518, z = -3135.0),
                Vector3(x = 410396.85150000005, y = -342257.53575, z = -3135.0),
                Vector3(x = 411768.26199999993, y = -342061.72325, z = -3135.0),
                Vector3(x = 413130.0325, y = -341864.70575, z = -3135.0),
                Vector3(x = 414503.06975, y = -341662.2055, z = -3135.0),
                Vector3(x = 415945.3945, y = -341446.81175, z = -3135.0),
                Vector3(x = 417316.26275, y = -341239.2505, z = -3135.0),
                Vector3(x = 418854.0235, y = -341002.88975000003, z = -3135.0),
                Vector3(x = 420300.626, y = -340777.85599999997, z = -3135.0),
                Vector3(x = 421735.29899999994, y = -340550.29175, z = -3135.0),
                Vector3(x = 423107.43250000005, y = -340308.93025, z = -3135.0),
                Vector3(x = 424547.46775, y = -340048.349, z = -3135.0),
                Vector3(x = 425940.56825, y = -339795.41949999996, z = -3135.0),
                Vector3(x = 427284.44450000004, y = -339547.79199999996, z = -3135.0),
                Vector3(x = 428686.52225000004, y = -339286.307, z = -3135.0),
                Vector3(x = 430016.782, y = -339035.84775, z = -3135.0),
                Vector3(x = 431412.95525, y = -338769.18124999997, z = -3135.0),
                Vector3(x = 432748.33625, y = -338510.769, z = -3135.0),
                Vector3(x = 434169.453, y = -338232.71525, z = -3135.0),
                Vector3(x = 435522.427, y = -337964.12075, z = -3135.0),
                Vector3(x = 436934.56649999996, y = -337681.66875, z = -3135.0),
                Vector3(x = 438271.39350000006, y = -337411.14625, z = -3135.0),
                Vector3(x = 439653.5285, y = -337128.0315, z = -3135.0),
                Vector3(x = 440978.24525000004, y = -336853.171, z = -3135.0),
                Vector3(x = 442391.168, y = -336567.104, z = -3135.0),
                Vector3(x = 443723.83775, y = -336300.31700000004, z = -3135.0),
                Vector3(x = 445120.6135, y = -336015.09349999996, z = -3135.0),
                Vector3(x = 446433.64174999995, y = -335744.14925, z = -3135.0),
                Vector3(x = 447793.60475000006, y = -335460.914, z = -3135.0),
                Vector3(x = 449156.09825000004, y = -335172.97925, z = -3135.0),
                Vector3(x = 450456.35349999997, y = -334896.6125, z = -3135.0),
                Vector3(x = 451809.32749999996, y = -334605.364, z = -3135.0),
                Vector3(x = 453113.55925, y = -334321.28525, z = -3135.0),
                Vector3(x = 454470.088, y = -334023.16825, z = -3135.0),
                Vector3(x = 455761.54675000004, y = -333735.2335, z = -3135.0),
                Vector3(x = 457028.9055, y = -333450.6125, z = -3135.0),
                Vector3(x = 458349.88675, y = -333151.0495, z = -3135.0),
                Vector3(x = 459586.93974999996, y = -332867.57324999996, z = -3135.0),
                Vector3(x = 460915.81375000003, y = -332558.6715, z = -3135.0),
                Vector3(x = 462139.85275, y = -332272.90575000003, z = -3135.0),
                Vector3(x = 463435.04699999996, y = -331967.31775, z = -3135.0),
                Vector3(x = 464661.01399999997, y = -331675.286, z = -3135.0),
                Vector3(x = 465952.95475000003, y = -331363.97425, z = -3135.0),
                Vector3(x = 467184.1635, y = -331064.04975, z = -3135.0),
                Vector3(x = 468388.56100000005, y = -330756.41325, z = -3135.0),
                Vector3(x = 469644.71325000003, y = -330408.65025, z = -3135.0),
                Vector3(x = 470893.81625, y = -330065.888, z = -3135.0),
                Vector3(x = 472141.2925, y = -329721.74, z = -3135.0),
                Vector3(x = 473326.41000000003, y = -329391.329, z = -3135.0),
                Vector3(x = 474569.54825, y = -329040.49325, z = -3135.0),
                Vector3(x = 475740.02499999997, y = -328707.61199999996, z = -3135.0),
                Vector3(x = 476938.81925, y = -328364.24725, z = -3135.0),
                Vector3(x = 478122.49075, y = -328021.42475, z = -3135.0),
                Vector3(x = 479311.82575, y = -327675.10775, z = -3135.0),
                Vector3(x = 480489.29150000005, y = -327328.67024999997, z = -3135.0),
                Vector3(x = 481666.21499999997, y = -326980.06375, z = -3135.0),
                Vector3(x = 482820.72549999994, y = -326634.22875, z = -3135.0),
                Vector3(x = 483982.52625, y = -326284.41725, z = -3135.0),
                Vector3(x = 485136.4945, y = -325933.64175, z = -3135.0),
                Vector3(x = 486291.42675000004, y = -325580.5165, z = -3135.0),
                Vector3(x = 487493.113, y = -325209.6175, z = -3135.0),
                Vector3(x = 488634.91075, y = -324854.92575, z = -3135.0),
                Vector3(x = 489833.46400000004, y = -324479.267, z = -3135.0),
                Vector3(x = 491023.04000000004, y = -324103.36725, z = -3135.0),
                Vector3(x = 492225.871, y = -323719.45425, z = -3135.0),
                Vector3(x = 493429.18400000007, y = -323332.22750000004, z = -3135.0),
                Vector3(x = 494308.53275, y = -323046.94375, z = -3135.0),
                Vector3(x = 495982.338, y = -322499.87374999997, z = -3135.0),
                Vector3(x = 497161.12925, y = -322110.41775, z = -3135.0),
                Vector3(x = 498295.75725, y = -321732.831, z = -3135.0),
                Vector3(x = 499462.137, y = -321341.50725, z = -3135.0),
                Vector3(x = 500604.89875000005, y = -320956.99175, z = -3135.0),
                Vector3(x = 501765.61500000005, y = -320568.6805, z = -3135.0),
                Vector3(x = 502927.65675, y = -320175.66975, z = -3135.0),
                Vector3(x = 504058.24799999996, y = -319790.06975, z = -3135.0),
                Vector3(x = 505198.23825, y = -319398.44474999997, z = -3135.0),
                Vector3(x = 506335.87875000003, y = -319004.5905, z = -3135.0),
                Vector3(x = 507520.63474999997, y = -318591.2755, z = -3135.0),
                Vector3(x = 508661.83, y = -318190.19125, z = -3135.0),
                Vector3(x = 509787.23975, y = -317791.93875000003, z = -3135.0),
                Vector3(x = 510923.856, y = -317386.21525, z = -3135.0),
                Vector3(x = 512059.99025, y = -316977.419, z = -3135.0),
                Vector3(x = 513184.7975, y = -316569.88800000004, z = -3135.0),
                Vector3(x = 514312.4365, y = -316162.598, z = -3135.0),
                Vector3(x = 515202.02775, y = -315892.43700000003, z = -3135.0),
                Vector3(x = 516994.22425, y = -315371.395, z = -3135.0),
                Vector3(x = 518194.04275, y = -315018.45050000004, z = -3135.0),
                Vector3(x = 519490.74325000006, y = -314633.15174999996, z = -3135.0),
                Vector3(x = 519639.2595, y = -314588.7475, z = -3135.0),
                Vector3(x = 521408.25975, y = -314057.64375, z = -3135.0),
                Vector3(x = 522690.56049999996, y = -313668.91075000004, z = -3135.0),
                Vector3(x = 523976.23525, y = -313275.11675, z = -3135.0),
                Vector3(x = 525349.57375, y = -312850.776, z = -3135.0),
                Vector3(x = 526466.72925, y = -312502.6515, z = -3135.0),
                Vector3(x = 527769.45475, y = -312091.7465, z = -3135.0),
                Vector3(x = 528970.1167499999, y = -311710.364, z = -3135.0),
                Vector3(x = 529914.2945, y = -311408.2705, z = -3135.0),
                Vector3(x = 531644.49375, y = -310849.271, z = -3135.0),
                Vector3(x = 532884.19775, y = -310445.35500000004, z = -3135.0),
                Vector3(x = 534061.4225, y = -310059.1525, z = -3135.0),
                Vector3(x = 535412.9504999999, y = -309612.15775, z = -3135.0),
                Vector3(x = 536589.151, y = -309219.388, z = -3135.0),
                Vector3(x = 537440.0015, y = -308933.321, z = -3135.0),
                Vector3(x = 541102.6592499999, y = -307683.55525000003, z = -3135.0),
                Vector3(x = 542287.2345, y = -307273.1925, z = -3135.0),
                Vector3(x = 543503.50125, y = -306847.707, z = -3135.0),
                Vector3(x = 544699.10225, y = -306427.162, z = -3135.0),
                Vector3(x = 545911.6335, y = -305996.3745, z = -3135.0),
                Vector3(x = 546664.33675, y = -305727.1775, z = -3135.0),
                Vector3(x = 632571.43775, y = -277069.38550000003, z = -3334.5),
                Vector3(x = 633754.6875, y = -276565.99675, z = -3334.5),
                Vector3(x = 634983.426, y = -276039.77325, z = -3334.5),
                Vector3(x = 635215.509, y = -275939.939, z = -3334.5),
                Vector3(x = 636983.6657499999, y = -275174.22174999997, z = -3336.875),
                Vector3(x = 638193.787, y = -274646.43175000005, z = -3334.5),
                Vector3(x = 639395.95525, y = -274118.03925, z = -3334.5),
                Vector3(x = 640606.5585, y = -273581.3925, z = -3334.5),
                Vector3(x = 641760.105, y = -273066.43575, z = -3334.5),
                Vector3(x = 642980.5892500001, y = -272518.64275, z = -3334.5),
                Vector3(x = 644151.9095, y = -271989.467, z = -3334.5),
                Vector3(x = 645313.891, y = -271460.1105, z = -3334.5),
                Vector3(x = 646543.5935000001, y = -270896.35125, z = -3334.5),
                Vector3(x = 647693.6455, y = -270365.7295, z = -3334.5),
                Vector3(x = 648896.9585, y = -269805.284, z = -3334.5),
                Vector3(x = 650050.6255, y = -269265.26325, z = -3334.5),
                Vector3(x = 651222.8495, y = -268712.349, z = -3334.5),
                Vector3(x = 652387.8435000001, y = -268159.8565, z = -3334.5),
                Vector3(x = 653546.8125, y = -267606.70125, z = -3334.5),
                Vector3(x = 654725.0615, y = -267040.65249999997, z = -3334.5),
                Vector3(x = 655872.4625, y = -266485.6295, z = -3334.5),
                Vector3(x = 657069.20825, y = -265901.86725, z = -3334.5),
                Vector3(x = 658206.3667499999, y = -265343.892, z = -3334.5),
                Vector3(x = 659343.224, y = -264782.66325, z = -3334.5),
                Vector3(x = 660539.307, y = -264188.538, z = -3334.5),
                Vector3(x = 661654.414, y = -263630.623, z = -3334.5),
                Vector3(x = 662774.52175, y = -263066.3215, z = -3334.5),
                Vector3(x = 663889.207, y = -262502.02, z = -3334.5),
                Vector3(x = 664995.93925, y = -261937.41725, z = -3334.5),
                Vector3(x = 666101.16525, y = -261370.58525000003, z = -3334.5),
                Vector3(x = 667208.56025, y = -260798.69225000002, z = -3334.5),
                Vector3(x = 667781.116, y = -260464.606, z = -3334.5),
                Vector3(x = 667873.35875, y = -260389.47425, z = -3334.5),
                Vector3(x = 668024.8875000001, y = -260241.86174999998, z = -3334.5),
                Vector3(x = 668083.6915, y = -260173.41775, z = -3332.125),
                Vector3(x = 668156.4735, y = -260076.355, z = -3334.5),
                Vector3(x = 668205.09525, y = -260001.82575, z = -3334.5),
                Vector3(x = 668259.6215, y = -259903.43750000003, z = -3334.5),
                Vector3(x = 668317.823, y = -259774.92424999998, z = -3334.5),
                Vector3(x = 668374.5182500001, y = -259643.3985, z = -3334.5),
                Vector3(x = 668757.5877500001, y = -258738.98575, z = -3334.5),
                Vector3(x = 669120.4735, y = -257868.79499999998, z = -3334.5),
                Vector3(x = 669476.069, y = -257019.81225, z = -3334.5),
                Vector3(x = 669882.45525, y = -256048.763, z = -3334.5),
                Vector3(x = 670257.5115, y = -255145.8565, z = -3334.5),
                Vector3(x = 670371.866, y = -254868.345, z = -3334.5),
                Vector3(x = 670813.79975, y = -253796.31674999997, z = -3334.5),
                Vector3(x = 671875.5854999999, y = -251192.31175000002, z = -3334.5),
                Vector3(x = 672233.8319999999, y = -250305.73299999998, z = -3334.5),
                Vector3(x = 672576.534, y = -249452.17125, z = -3334.5),
                Vector3(x = 672949.54175, y = -248520.52550000002, z = -3334.5)
            ), false
        )

        val fullLength = c.length
        val sub = c.sampleEquidistant(600).sub(0.01, 0.05)
        assertEquals(
            fullLength * 0.04,
            sub.length,
            fullLength * 1e-5
        )
    }
}